﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Could.Service
{
    public class LexiconForm
    {
		public string Word ;
		public string Relation ;
		public string XMLContext ;
		public string Sentence ;
        public string Voice;
    }


    public class Cattmscreators
    {
        public int ID;
        public string user_machineid;
        public string user_id;
        public string user_email;
        public string user_pw;
        public string XMLData;
        public Boolean online;
        public string last_login_time;
        public string yaoqingma;
        public string error;
        public string columns;
        public System.Collections.ArrayList enginelist;
        public string fileid;

        public int EnginxID ;
        public string textTmsField ;
        public string indexTmsField ;
        public string textTdbField ;
        public string indexTdbField ;
    }

    public class CheckData
    {
        public string CtlID;
        public Boolean status;
        public string sMessage;
    }

    [Serializable]
    public class TransData
    {
        public int TmsID, TdbID;
        public string OSentence,TSentence;
        public string OLibrary, TLibrary;
        public string TmsTitle,TmsResult;
        public string TdbTitle,TdbResult;
        public int TmsSearchLevel;
        public int TmsTotal, TdbTotal;
        public string textTmsField, indexTmsField;
        public string textTdbField, indexTdbField;
        public ArrayList ArrList;
        //public string oText, tText, oTerm, tTerm;
        public long ElapsedTime;
    }
    [Serializable]
    public class IndexServerData
    {
        public string userid;
        public string id;
        public string ip;
        public string Capability;
        public int from;
        public int to;
        public int enginx;
        public string xmldata;
        public string root;
        public string path
        {
            get{
                return root + subdir + userid;
            }
        }
        public string subdir;
        public DbServerData dbserver;
    }
    [Serializable]
    public class DbServerData
    {
        public string type;
        public string ip;
        public string usr;
        public string ps;
        public string port;
        public string average;
        public string itable;
        public string tmsname;
        public string tmstable;
        public string tmsquery;
        public string tdbname;
        public string tdbtable;
        public string tdbquery;
        public string sqlconnection
        {
            get
            {
                return "character set=utf8;server=" + ip + ";uid=" + usr + ";pwd=" + ps + ";";
            }
        }
    }
    [Serializable]
    public class AdvertData
    {
        public int AdvData;
        public string sData;
    }

    [Serializable]
    public class NPClass
    {
        public int UserID;
        public int FileID;
        public int CommandCode, MainFuzzyLevel;
        public int EnginxID, CatFactoryID;
        public TransData transdata;
        public IndexServerData IndSPrivate;
        public IndexServerData IndSMain;
        public AdvertData AdS;
        public DbServerData DbSPrivate
        {
            get{
                return IndSPrivate.dbserver;
            }
        }
        public DbServerData DbSMain
        {
            get
            {
                return IndSMain.dbserver;
            }
        }
        //public string textField;
        //public string indexField;
        //public string oTerm;
        //public string tTerm;
        
        public string error;
        public int Total;
        public string PrivateIndexTMSPath
        { 
            get{
            return  IndSPrivate.path + "/" + FileID +"/tms/";
        }}
        public string PrivateIndexTDBPath
        {
            get
            {
                return IndSPrivate.path + "/" + FileID + "/tdb/";
            }
        }
        public string MainIndexTMSPath
        {
            get{
                return IndSMain.root + "/tms/";
            }
        }
        public string MainIndexTDBPath
        {
            get{
                return IndSMain.root + "/tdb/";
            }
        }

        public NPClass() {
            transdata = new TransData();
            //DbS = new DbServerData();
            IndSPrivate = new IndexServerData();
            IndSMain = new IndexServerData();
            AdS = new AdvertData();
        }

    }
    [Serializable]
    public class Tdb
    {
        public string ID;
        public string oTerm;
        public string tTerm;
        public int WordLen;
        public int SumKey;
    }

    [Serializable]
    public class Tms
    {
        public string ID;
        public string oText;
        public string tText;
    }
}